#!/bin/sh -e

. CI/travis/lib.sh

# Note: not installing 'mono', it comes with Azure images,
# but it doesn't look it's installed with Homebrew

brew_install_if_not_exists cmake doxygen libusb libxml2 swig curl python

if [ -n "$PACKAGE_TO_INSTALL" ] ; then
	for file in $PACKAGE_TO_INSTALL ; do
		sudo installer -pkg "${file}" -target /
	done
elif [ "$INSTALL_FROM_SW_DOWNLOADS" = "1" ] ; then
	wget http://swdownloads.analog.com/cse/travis_builds/${LIBIIO_BRANCH}_latest_libiio${LDIST}.pkg
	sudo installer -pkg ${LIBIIO_BRANCH}_latest_libiio${LDIST}.pkg -target /
fi

cd ${TOP_DIR}
git clone --branch v0.4.0 --depth 1 https://github.com/google/glog
mkdir -p glog/build_0_4_0 && cd glog/build_0_4_0
cmake ..
make
sudo make install

pip3 install wheel twine build virtualenv
